package com.study.example.gameserver.admin.recharge.entity;


import com.sparrow.cache.annotation.Cache;
import com.sparrow.cache.annotation.CacheType;
import com.sparrow.cache.entity.AbstractEntity;
import com.sparrow.common.util.TimeUtil;
import javax.persistence.*;
import java.io.Serializable;

/**
 * 充值订单记录表
 */
@Cache(cacheType = CacheType.LRU)
@Entity
@Table(name = "RechargePay")
public class RechargePay extends AbstractEntity<String> implements Serializable {

    @Id
    @Column(length = 64, nullable = false)
    private String orderId;     // 订单号（唯一标识）

    private String account;     // 账号

    private Long playerId;      // 玩家ID

    private int serverId;    // 服务器ID

    private int money;      // 充值金额

    private int status; // 1发货中  2已发货 3发货失败

    private int createTime;

    public RechargePay() {
    }


    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(Long playerId) {
        this.playerId = playerId;
    }

    public int getServerId() {
        return serverId;
    }

    public void setServerId(int serverId) {
        this.serverId = serverId;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public int getCreateTime() {
        return createTime;
    }

    public void setCreateTime(int createTime) {
        this.createTime = createTime;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return "RechargePay{" +
                "orderId='" + orderId + '\'' +
                ", account='" + account + '\'' +
                ", playerId=" + playerId +
                ", serverId='" + serverId + '\'' +
                ", money=" + money +
                ", createTime=" + createTime +
                '}';
    }

    @Override
    public String getPK() {
        return orderId;
    }

    @Override
    public long dispatchCode() {
        return playerId;
    }
}

